package gui;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.border.LineBorder;

public class CritterFilesFrame extends JFrame {
	private String[] fileNames;
	
	private JPanel containerPanel;
	private JTextArea fileText;
	
	private final Color bkg = new Color(255,99,71);
	
	public CritterFilesFrame(String[] files){
		fileNames = files;
		
		setSize(200, 500);
		setTitle("List of critter files");
		containerPanel = new JPanel();
		containerPanel.setBorder(new LineBorder(bkg, 3));
		add(containerPanel);
		
		StringBuffer sb = new StringBuffer();
		for(String s : fileNames)
			sb.append(s + "\n");
		fileText = new JTextArea(sb.toString()){
			public Dimension getMinimumSize(){
				return new Dimension(100, 400);
			}
		};
		fileText.setEditable(false);
		containerPanel.add(fileText);
		
		containerPanel.setBackground(bkg);
		fileText.setBackground(bkg);
		setVisible(true);
	}
}
